<?php
//$this->load->model('pr_fnc_model', '', true);
if($type == "type")
{
	if(count($accounts)>0)
	{		$options['']	= 'Please select model';
		foreach ($accounts as $account) :
			$options[$account['acc_name']]	= $account['acc_name'];
			$type_id						= $account['type_id'];
		endforeach ;								
		$js = 'id="sw_model1" class="select w190"';
		echo form_dropdown('sw_model', $options, '', $js);
		?>
		<span style="color:#FF0000">*</span>
		<?=form_input(array('acc_id' => $type_id))?> 
        
        <?=form_input(array('name' 		=> 'type_id1',
                                    'id' 			=> 'type_id1',
                                    'class' 		=> 'inputtext w180 title',
									'value'			=> $type_id
									))?>   
        <script type="text/javascript">
			$('sw_model1').addEvent('change', function(e)
			{
				e.stop();
				new Request.HTML({
					url: admin_url + 'pr_tab_account_cl/switchbymodel/<?= $form?>',
					method: 'post',
					loadMethod: 'xhr',
					data: $('<?= $form?>'),
					update: $('switch'),
					onRequest: function() { MUI.showSpinner();},
					onFailure: function(xhr) { MUI.hideSpinner();},
					onComplete: function() { MUI.hideSpinner();}
				}).send();
			});	
		</script>
<?php	
	}
	else
	{
		echo form_dropdown('', array(''=>'No Record'), '&nbsp;', 'class="select w190" style="color:#990000;"');
		echo '<span style="color:#FF0000">*</span> ';
	}
}else{echo "Not complete..!";}
?>